import 'xe-utils'
import VXETable from 'vxe-table'
import VXETablePluginAntd from 'vxe-table-plugin-antd'
import { getLocalSetting } from '@/utils/themeUtil'
import { ADMIN } from '@/config/default'

// import 'vxe-table/lib/style.css'
// import 'vxe-table/styles/index.scss'
// import '../theme/vxe-table/default.scss'

// 引入修改过的vxe-table样式，适配框架换肤功能
const localSetting = getLocalSetting() || {}
const themeMode = ADMIN.theme.mode
const fileName = localSetting.theme && localSetting.theme.mode === themeMode.NIGHT ? 'night' : 'default'
// 根据默认主题加载对应表格主题
import(`../theme/vxe-table/${fileName}.scss`)
import 'vxe-table-plugin-antd/dist/style.css'

VXETable.use(VXETablePluginAntd)

// 全局默认参数
// VXETable.setup({
//   version: 0,
//   zIndex: 999,
//   table: {
//     autoResize: true
//   }
// })

// 将模态窗口挂载到 vue 实例中
// Vue.prototype.$XModal = VXETable.modal
export default VXETable
